<?PHP
session_start();
header("Content-type: text/html; charset=utf-8");
//error_reporting(6143);
require_once("../include/conn.php");
$pwd=md5(trim($_POST['pwd']));
$name=trim($_POST['name']);
$sql_login="SELECT * FROM `bl_admin` WHERE name = '$name' AND pwd = '$pwd'";
$cn_login = mysql_db_query($db_name,$sql_login);
$loginp=mysql_fetch_row($cn_login);
if(!$loginp){	
	//print_r($_SESSION);
	//echo "对不起，你不是管理员！";
	//die();
	self("对不起，您不是管理员!","login.php");		
}
else {
	$_SESSION["name"]="admin";
	$_SESSION["level"]=$loginp[2];
	//print_r($_SESSION);die();
	self("欢迎您网站登陆管理系统!","admin_index.php");
}
?>

